home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1998 May / PCPlus May 1998=disk A.iso / full / CBUILDER / SAMS / SAMPLES / CHAP13 / SURF00.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-12  |  1.7 KB  |  50 lines

  1. //---------------------------------------------------------------------------
  2. #include <vcl\vcl.h>
  3. #pragma hdrstop
  4.  
  5. #include "surf00.h"
  6. //---------------------------------------------------------------------------
  7. #pragma resource "*.dfm"
  8. TForm1 *Form1;
  9. String HomePage = "http://www.borland.com";
  10. //---------------------------------------------------------------------------
  11. __fastcall TForm1::TForm1(TComponent* Owner)
  12.     : TForm(Owner)
  13. {
  14. }
  15. //---------------------------------------------------------------------------
  16. void __fastcall TForm1::tcURLChange(TObject *Sender)
  17. {
  18.   cbURL->Text=tcURL->Tabs->Strings[tcURL->TabIndex];
  19.   cbURL->SelectAll();
  20.   bbGo->Click();
  21. }
  22. //---------------------------------------------------------------------------
  23. void __fastcall TForm1::htBrowserBeginRetrieval(TObject *Sender)
  24. {
  25. Cursor=(TCursor)crHourGlass;
  26. if (cbURL->Items->IndexOf(htBrowser->URL)==-1) {
  27.     cbURL->Items->Add(htBrowser->URL);
  28.     cbURL->Text=htBrowser->URL;
  29.     cbURL->SelectAll();
  30.     tcURL->Tabs->Add(htBrowser->URL);
  31.     tcURL->TabIndex=tcURL->Tabs->Count-1;
  32.     bbGo->Click();
  33.   }
  34. }
  35. //---------------------------------------------------------------------------
  36. void __fastcall TForm1::htBrowserEndRetrieval(TObject *Sender)
  37. {
  38.   Cursor=(TCursor)crDefault;    
  39. }
  40. //---------------------------------------------------------------------------
  41. void __fastcall TForm1::bbGoClick(TObject *Sender)
  42. {
  43.   htBrowser->RequestDoc(cbURL->Text);    
  44. }
  45. //---------------------------------------------------------------------------
  46. void __fastcall TForm1::bbHomeClick(TObject *Sender)
  47. {
  48.   htBrowser->RequestDoc(HomePage);    
  49. }
  50. //---------------------------------------------------------------------------